package org.ellwood.framework.common.exception;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import org.ellwood.framework.common.core.enums.HttpCodeEnum;

/**
 * @BelongsProject: ellwood-pro
 * @BelongsPackage: org.ellwood.framework.common.exception
 * @BelongsClass: SystemException
 * @Description: // 自定义异常
 * @Author: ellwood
 * @CreateTime: 2024/1/30 - 16:23
 * @Version: V1.0.0
 */
@Schema(description = "系统异常")
@Getter
public class SystemException extends RuntimeException  {

    @Schema(description = "异常状态码")
    private int code;
    @Schema(description = "异常信息")
    private String msg;

    public  SystemException(HttpCodeEnum codeEnum){
        super(codeEnum.getMsg());
        this.code=codeEnum.getCode();
        this.msg=codeEnum.getMsg();
    }

}
